home *** CD-ROM | disk | FTP | other *** search
/ Windows Game Programming for Dummies (2nd Edition) / WinGamProgFD.iso / pc / DirectX SDK / DXSDK / samples / Multimedia / DirectShow / Players / Jukebox / JukeboxDlg.h < prev    next >
Encoding:
C/C++ Source or Header  |  2001-10-09  |  4.7 KB  |  159 lines

  1. //==========================================================================;
  2. //
  3. //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
  4. //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  5. //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
  6. //  PURPOSE.
  7. //
  8. //  Copyright (c) 1998-2001  Microsoft Corporation.  All Rights Reserved.
  9. //
  10. //--------------------------------------------------------------------------;
  11. // JukeboxDlg.h : header file
  12. //
  13.  
  14. #if !defined(AFX_JUKEBOXDLG_H__04AD8433_DF22_4491_9611_260EDAE17B96__INCLUDED_)
  15. #define AFX_JUKEBOXDLG_H__04AD8433_DF22_4491_9611_260EDAE17B96__INCLUDED_
  16.  
  17. #if _MSC_VER > 1000
  18. #pragma once
  19. #endif // _MSC_VER > 1000
  20.  
  21. #include <dshow.h>
  22.  
  23. //
  24. // Constants
  25. //
  26. const int TICKLEN=100, TIMERID=55;
  27.  
  28.  
  29. /////////////////////////////////////////////////////////////////////////////
  30. // CJukeboxDlg dialog
  31.  
  32. class CJukeboxDlg : public CDialog
  33. {
  34. // Construction
  35. public:
  36.     CJukeboxDlg(CWnd* pParent = NULL);    // standard constructor
  37.     void FillFileList(LPTSTR pszCmdLine);
  38.  
  39.     HRESULT PrepareMedia(LPTSTR lpszMovie);
  40.     BOOL DisplayFileInfo(LPTSTR szFile);
  41.     HRESULT DisplayFileDuration(void);
  42.     BOOL DisplayImageInfo(void);
  43.     void Say(LPTSTR szText);
  44.  
  45.     LONG GetDXMediaPath(TCHAR *strPath);
  46.     LONG GetGraphEditPath(TCHAR *szPath);
  47.     void InitMediaDirectory(void);
  48.  
  49.     HRESULT InitDirectShow(void);
  50.     HRESULT FreeDirectShow(void);
  51.     HRESULT HandleGraphEvent(void);
  52.  
  53.     void ResetDirectShow(void);
  54.     void DisplayECEvent(long lEventCode, long lParam1, long lParam2);
  55.     void CenterVideo(void);
  56.     void PlayNextFile(void);
  57.     void PlayPreviousFile(void);
  58.     void PlaySelectedFile(void);
  59.     void ShowState(void);
  60.     void ConfigureSeekbar(void);
  61.     void StartSeekTimer(void);
  62.     void StopSeekTimer(void);
  63.     void HandleTrackbar(WPARAM wReq);
  64.     void UpdatePosition(REFERENCE_TIME rtNow);
  65.     void ReadMediaPosition(void);
  66.  
  67.     BOOL CanStep(void);
  68.     HRESULT StepFrame(void);
  69.     HRESULT EnumFilters(void);
  70.     HRESULT EnumPins(IBaseFilter *pFilter, PIN_DIRECTION PinDir, CListBox& Listbox);
  71.     IBaseFilter * FindFilterFromName(LPTSTR szName);
  72.     BOOL SupportsPropertyPage(IBaseFilter *pFilter);
  73.  
  74.     void CALLBACK MediaTimer(UINT wTimerID, UINT msg, ULONG dwUser, ULONG dw1, ULONG dw2);
  75.  
  76.  
  77.     // Dialog Data
  78.     //{{AFX_DATA(CJukeboxDlg)
  79.     enum { IDD = IDD_JUKEBOX_DIALOG };
  80.     CStatic    m_StrPosition;
  81.     CSliderCtrl    m_Seekbar;
  82.     CStatic    m_StrImageSize;
  83.     CStatic    m_StrDuration;
  84.     CEdit    m_EditMediaDir;
  85.     CSpinButtonCtrl    m_SpinFiles;
  86.     CButton    m_ButtonFrameStep;
  87.     CListBox    m_ListEvents;
  88.     CButton    m_CheckEvents;
  89.     CButton    m_ButtonProperties;
  90.     CStatic    m_StrMediaPath;
  91.     CButton    m_CheckMute;
  92.     CButton    m_ButtonStop;
  93.     CButton    m_ButtonPlay;
  94.     CButton    m_ButtonPause;
  95.     CButton    m_CheckPlaythrough;
  96.     CButton    m_CheckLoop;
  97.     CStatic    m_StrFileDate;
  98.     CStatic    m_StrFileSize;
  99.     CListBox    m_ListPinsOutput;
  100.     CListBox    m_ListPinsInput;
  101.     CStatic    m_StrFileList;
  102.     CStatic    m_Status;
  103.     CStatic    m_Screen;
  104.     CListBox    m_ListInfo;
  105.     CListBox    m_ListFilters;
  106.     CListBox    m_ListFiles;
  107.     //}}AFX_DATA
  108.  
  109.     // ClassWizard generated virtual function overrides
  110.     //{{AFX_VIRTUAL(CJukeboxDlg)
  111.     protected:
  112.     virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
  113.     virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam);
  114.     //}}AFX_VIRTUAL
  115.  
  116. // Implementation
  117. protected:
  118.     HICON m_hIcon;
  119.     int   m_nCurrentFileSelection;
  120.     REFERENCE_TIME g_rtTotalTime;
  121.     UINT_PTR g_wTimerID;
  122.     TCHAR m_szCurrentDir[MAX_PATH];
  123.  
  124.     // Generated message map functions
  125.     //{{AFX_MSG(CJukeboxDlg)
  126.     virtual BOOL OnInitDialog();
  127.     afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
  128.     afx_msg void OnPaint();
  129.     afx_msg HCURSOR OnQueryDragIcon();
  130.     afx_msg void OnClose();
  131.     afx_msg void OnSelectFile();
  132.     afx_msg void OnPause();
  133.     afx_msg void OnPlay();
  134.     afx_msg void OnStop();
  135.     afx_msg void OnCheckMute();
  136.     afx_msg void OnCheckLoop();
  137.     afx_msg void OnCheckPlaythrough();
  138.     afx_msg void OnSelchangeListFilters();
  139.     afx_msg void OnDblclkListFilters();
  140.     afx_msg void OnButtonProppage();
  141.     afx_msg void OnCheckEvents();
  142.     afx_msg void OnButtonFramestep();
  143.     afx_msg void OnButtonClearEvents();
  144.     afx_msg void OnDblclkListFiles();
  145.     afx_msg void OnDeltaposSpinFiles(NMHDR* pNMHDR, LRESULT* pResult);
  146.     afx_msg void OnButtonSetMediadir();
  147.     afx_msg void OnTimer(UINT nIDEvent);
  148.     afx_msg void OnButtonGraphedit();
  149.     afx_msg void OnDestroy();
  150.     afx_msg BOOL OnEraseBkgnd(CDC *);
  151.     //}}AFX_MSG
  152.     DECLARE_MESSAGE_MAP()
  153. };
  154.  
  155. //{{AFX_INSERT_LOCATION}}
  156. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  157.  
  158. #endif // !defined(AFX_JUKEBOXDLG_H__04AD8433_DF22_4491_9611_260EDAE17B96__INCLUDED_)
  159.